# 计算一个函数的运行时间
import time
def decorator(fn):
    def inner(*args, **kwargs):
        start = time.time()
        result = fn(*args, **kwargs)
        end = time.time()
        print(f'f程序运行的时间:{end - start}')
        return result
    return inner


@decorator
def fn1(frequency):
    for i in range(frequency):
        print(i)

if __name__ == '__main__':
    fn1(1000)
